import java.util.Scanner;

public class CalAirPrice {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("机票原价");
        double price = scanner.nextDouble();
        System.out.println("月份");
        int month = scanner.nextInt();
        System.out.println("舱位：1.头等舱 2.商务舱 3.经济舱");
        int type = scanner.nextInt();
        System.out.println(calAirPrica(price, month, type));
    }

    /**
     * 计算最终价格
     */
    public static double calAirPrica(double price, int month, int type) {
        double finalPrice = 0.0;//最终价格
        //算....
        if (month < 1 || month > 12) {
            System.out.println("月份不对");
            return -1;
        }
        if (type < 1 || type > 3) {
            System.out.println("没这个舱位");
            return -1;
        }
        if (month >= 5 && month <= 10) {
            switch (type) {
                case 1:
                    finalPrice = price * 0.9;
                    break;
                case 2:
                    finalPrice = price * 0.85;
                    break;
                case 3:
                    finalPrice = price * 0.8;
                    break;
            }

        } else {
            switch (type) {
                case 1:
                    finalPrice = price * 0.9;
                    break;
                case 2:
                    finalPrice = price * 0.85;
                    break;
                case 3:
                    finalPrice = price * 0.8;
                    break;
            }
        }
        return finalPrice;
    }
}